﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.Core.Entities
{
	public class Newsletter : BaseEntity
	{
		[StringLength(100)]
		public string Title { get; set; }
		[StringLength(100)]
		public string Symbols { get; set; }
		public byte Letter { get; set; }
		[StringLength(100)]
		public string PdfFileName { get; set; }
		public DateTime CreatedDate { get; set; }
		public DateTime Date { get; set; }

		public byte MinAccessLevel { get; set; }
        public byte MinAccessLevelOriginal { get; set; }
        public bool IsHide { get; set; }

		public virtual EmailMessage EmailMessage { get; set; }
		public virtual IssueType IssueType { get; set; }
        public virtual ICollection<NewsletterProduct> Products { get; set; }

        public string TitleForRecentIssues()
        {
            return Letter == 2 ? Title + " (MMM)" : Title;
        }
	}
}
